//
//  WordReportCell.m
//  laowu
//
//  Created by yinqy on 15/4/30.
//  Copyright (c) 2015年 长沙市岳麓区立早网络科技有限公司. All rights reserved.
//

#import "WorkReportCell.h"

@interface WorkReportCell()
@property (strong,nonatomic) NSIndexPath *indexPath;
@end
@implementation WorkReportCell


-(instancetype)initWithTabelView:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
    static  NSString  *CellIdentiferId = @"WorkReportCell";
    WorkReportCell  *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentiferId];
    if (cell == nil) {
        NSArray *nibs = [[NSBundle mainBundle]loadNibNamed:@"WorkReportCell" owner:nil options:nil];
        cell = [nibs lastObject];
    }
    cell.indexPath = indexPath;
    return cell;
}

-(void)setItemInfo:(WorkReportItemResult *)itemInfo{
    _itemInfo = itemInfo;
    [self.timeLabel setText:itemInfo.release_date];
    [self.projNameLabel setText:itemInfo.project_name];
    [self.wordStatusLabel setText:itemInfo.work_state];
}

- (IBAction)editBtnClick:(id)sender {
    if ([self.delegate respondsToSelector:@selector(workReportEditClick:)]) {
        [self.delegate workReportEditClick:self.indexPath];
    }
}
@end
